﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;

namespace GauntletFramework.StateManagment.Transition
{
    public class SlideRightTransitionState : TransitionState
    {
        public SlideRightTransitionState(float Time)
            : base(Time)
        {
        }

        public override GameOrientation GameOrientation { get { if (Progress < 0.5f) return Start.GameOrientation; else return End.GameOrientation; } }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            SpriteBatch sb = ((GNTMainGame)Game).SpriteBatch;

            Rectangle Left = StaticGame.ScreenSize, Right = StaticGame.ScreenSize;
            Left.X = (int)(Left.Width * Progress * 1f);
            Right.X = Left.X - Left.Width;


            sb.Draw(EndRenderTexture2D, Right, Color.White);
            sb.Draw(StartRenderTexture2D, Left, Color.White);
        }
    }
}
